package com.xhej.rowreat.conf;

import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.xhej.rowreat.interceptors.RuleInterceptor;

@Configurable
public class InterceptosConf extends WebMvcConfigurerAdapter {
	
	    @Bean
	    RuleInterceptor  ruleInterceptor(){
	        return new RuleInterceptor();
	    }
	 	
	 	@Override
 	    public void addInterceptors(InterceptorRegistry registry) {
 	        registry.addInterceptor(ruleInterceptor()).addPathPatterns("/**");
 	    }
}
